package comfive.maste;

import comfive.service.UserService;
import comfive.service.impl.UserServiceImpl;

import java.util.Scanner;

public class MasterCrm {
    UserService userService = new UserServiceImpl();


    public void toTest(){
        boolean isflag=true;
        do {
            System.out.println("请选择操作：1：登录，2：注册");
            Scanner scanner = new Scanner(System.in);
            int i = scanner.nextInt();
            switch (i){
                case 1:
                    System.out.println("请输入用户名：");
                    String uname = scanner.next();
                    System.out.println("请输入密码：");
                    String password = scanner.next();
                    boolean b = userService.loginToUser(uname, password);
                    if(b){
                        System.out.println("登录成功...请继续操作");
                        isflag=false;

                    }else {
                        System.out.println("用户名密码错误！");
                    }
                    break;
                case 2:
                    break;
                default:
                    System.exit(1);
            }
        }while (isflag);

    }


}
